use diesel::prelude::*;

use crate::database::schema;

#[derive(Queryable, Selectable)]
#[diesel(table_name = schema::image)]
#[diesel(check_for_backend(diesel::mysql::Mysql))]
pub struct Image {
    pub id: i32,
    pub pid: i32,
    pub url: String,
}

#[derive(Insertable)]
#[diesel(table_name = schema::image)]
pub struct NewImage {
    pub pid: i32,
    pub url: String,
}
